<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core" 
      >
    <h:head>
        
        <h:outputScript name="calendar_ru.js" library="js"/>
    </h:head>
    <h:body>
        <h:form id="symptoms">

            <p:dataTable var="health1" value="#{healthSymptoms.healthingSymptomsByPacientId()}" paginator="true" rows="10"  
                         rowKey="#{health1.healingSymptomId}" id="tablesymptoms" emptyMessage="Нет записей"> 

                <p:column  >  
                    <f:facet name="header">  
                        <h:outputText value="Название" />  
                    </f:facet>  
                    <h:outputText value="#{health1.symptomsBySymptomId.name}"/>  
                </p:column>  
                <p:column  >  
                    <f:facet name="header">  
                        <h:outputText value="Значение" />  
                    </f:facet>  
                    <h:outputText value="#{health1.value}"/>  
                </p:column>  
            </p:dataTable> 
            <p:commandButton value="Добавить" icon="ui-icon-plus" oncomplete="symptomsdialog.show()"/>

            <p:dialog header="Добавить Симптомы" widgetVar="symptomsdialog" resizable="false"  
                      width="300" showEffect="explode" hideEffect="explode">
                <h:panelGrid id="display1" columns="2" >
                    <h:outputText value="Название"/>
                    <h:outputText value="Значение"/>

                    <p:selectOneMenu value="#{healthSymptoms.sympId}" effect="fold" id="symp">  
                        <f:selectItems value="#{healthSymptoms.getSymptom111()}" />  
                    </p:selectOneMenu>
                    
                     <p:inputText value="#{healthSymptoms.value}"/>
                    <p:commandButton value="Сохранить" icon="ui-icon-disk" actionListener="#{healthSymptoms.save()}" update="symptoms:tablesymptoms" oncomplete="symptomsdialog.hide()"/>
                </h:panelGrid>     
            </p:dialog>  
        </h:form>

    </h:body>
</html>

